package redis.redisDemo;

import io.micrometer.common.util.StringUtils;
import io.netty.util.internal.StringUtil;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Author zhoucq
 * @Date 2025/9/17 19:08
 * @Version 1.0
 */
@RestController
public class RedisController {
    @Autowired
    RedissonClient redissonClient;
    @GetMapping("/")
    public String hello() {
        redissonClient.getBucket("name");
        if(StringUtils.isBlank(redissonClient.getBucket("name")+"")){
            redissonClient.getBucket("name").set("zhoucq");
        }
        return redissonClient.getBucket("name") + "";
    }
}
